import { Shape } from '@antv/x6'
import config, { NODE_SETING_ENUM } from '../config'
import baseOptions from './baseOptions'

export const CustomCircle = Shape.Circle.define({
  constructorName: 'custom-circle',
  ...baseOptions,
  width: 70,
  height: 70,
  markup: [
    ...baseOptions.markup,
    {
      tagName: 'circle',
      selector: 'body'
    }
  ],
  attrs: {
    ...baseOptions.attrs,
    body: {
      rx: 35,
      ry: 35,
      stroke: config.nodeStroke,
      strokeWidth: config.nodeStrokeWidth,
      fill: config.nodeBgColor
      // magnet: true
    }
  },
  data: {
    options: [
      NODE_SETING_ENUM.R,
      NODE_SETING_ENUM.FILL,
      NODE_SETING_ENUM.STROKE,
      NODE_SETING_ENUM.STROKE_WIDTH,
      NODE_SETING_ENUM.FONT_SIZE,
      NODE_SETING_ENUM.FONT_COLOR,
      NODE_SETING_ENUM.TEXT_WRAP
    ]
  }
})
